﻿using ProjectManage.Core.Entity;

namespace ProjectManage.Application.System.Services
{
    public interface ISystemService
    {
        #region 通用方法
        /// <summary>
        /// 通用删除
        /// </summary>
        /// <typeparam name="T">数据库对象</typeparam>
        /// <param name="input">输入参数</param>
        /// <returns></returns>
        public Task DeleteMutiAsync<T>(List<DeleteDto> input) ;

        /// <summary>
        /// 通用更新
        /// </summary>
        /// <typeparam name="T">数据库对象</typeparam>
        /// <typeparam name="T1">DTO对象</typeparam>
        /// <param name="input">入参</param>
        /// <returns></returns>
        public Task UpdateAsync<TDataBase, TUpdateDto>(TUpdateDto input) where TDataBase : DBEntityBase<Guid, MasterDbContextLocator> where TUpdateDto : BaseUpdate;
        #endregion

        #region 用户
        public Task AddUserAsync(AddUserDto input);

        public Task UpdateUserAsync(UpdateUserDto input);

        public Task DeleteMutiUserAsync(List<DeleteDto> input);

        public Task<PagedList<QueryUserDto>> QueryUserAsync(QueryParameter options);
        #endregion

        #region 登录
        public Task<TokenModel> LoginAsync(LoginDto input);

        public Task<TokenModel> ThreeLoginAsync(LoginDto input);
        #endregion

        #region 角色
        public Task AddRoleAsync(AddRoleDto input);

        public Task UpdateRoleAsync(UpdateRoleDto input);

        public Task DeleteMutiRoleAsync(List<DeleteDto> input);

        public Task<PagedList<QueryRoleDto>> QueryRoleAsync(QueryParameter options);
        #endregion


        #region 数据字典
        public Task AddDictionaryAsync(AddDictionaryDto input);

        public Task<PagedList<QueryDictionaryDto>> QueryDictionaryAsync(QueryParameter options);

        public Task<List<SelectedItem>> QueryDictionaryByTypeAsync(string type);
        #endregion


        #region 菜单
        public Task AddMenuAsync(AddMenuDto input);

        public Task<List<QueryMenuDto>> QueryMenuAsync();

        public Task<List<QueryMenuDto>> QueryMenusByRoleCodeAsync(string role);

        public Task<List<QueryMenuDto>> QueryButtonsByAccountAsync(string Account);
        
        public Task<List<QueryMenuItem>> QueryMenusByAccountAsync(string Account, string AppCode);
        #endregion


        #region 用户角色关系
        public Task AddUserRoleAsync(AddUserRoleDto input);

        public Task<PagedList<QueryUserRoleDto>> QueryUserRoleAsync(QueryParameter options);
        #endregion

        #region 角色菜单
        public Task AddRoleMenuAsync(AddRoleMenuDto input);

        public Task UpdateRoleMenuAsync(UpdateRoleMenuDto input);

        public Task<PagedList<QueryRoleMenuDto>> QueryRoleMenuAsync(QueryParameter options);

       
        #endregion
    }
}